package ${package.Service};

import java.lang.reflect.Method;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.hbsj.core.entity.MapEntity;
import com.hbsj.core.entity.MapResponse;
import com.hbsj.core.service.ServiceInvoker;

@Component
public class ${entity}Invoker extends ServiceInvoker{

	@Autowired
	${entity}Service service;

	@Override
	public void scan() {
		if(SERVICE_METHODS.size() > 0){
			return ;
		}
		for(Method m : ${entity}Service.class.getMethods()) {
			SERVICE_METHODS.put(m.getName(), m);
		}
	}

	public MapResponse create(MapEntity params) {
		return (MapResponse) invoke("create", service, params);
	}

	public MapResponse update(MapEntity params) {
		return (MapResponse) invoke("update", service, params);
	}

	public MapResponse del(MapEntity params) {
		return (MapResponse) invoke("del", service, params);
	}

	public MapResponse get(MapEntity params) {
		return (MapResponse) invoke("get", service, params);
	}

	public MapResponse getPageList(MapEntity params) {
		return (MapResponse) invoke("getPageList", service, params);
	}

}
